

export class ScriptManager {
    stop(path: string): void {
        engines.all().map(it => {
            if (it.getSource() == path) {
                it.forceStop()
            }
        })
    }
    start(path: string): void {
        engines.execScriptFile(path)
    }
    isRuning(path: string): boolean {
        let hasRuning: boolean = false;
        engines.all().map(it => {
            if (it.getSource() == path) {
                hasRuning = true;
            }
        })
        return hasRuning;
    }
}

export const scriptManager = new ScriptManager()